<?php
require_once 'header.php';
// Cookie中无管理员信息代表管理员未登录，跳转到登录界面
if($_COOKIE["adminName"] == null || $_COOKIE["adminID"] == null){
	echo "<script>location.href='login.php'</script>";
}
?>

<div class="container-fluid " style="background: rgba(255,255,255,0.62)">
    <nav class="navbar navbar-expand-lg navbar-light">
        <a class="navbar-brand" href="/admin/#">
        </a>
        <button class="navbar-toggler"
                type="button"
                data-toggle="collapse"
                data-target="#navbarSupportedContent"
                aria-controls="navbarSupportedContent"
                aria-expanded="false"
                aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav mr-auto">
                <li class="nav-item">
                    <a class="nav-link" href="templateIndex.php" target="adminFrame">模板管理</a>
                </li>
	            <li class="nav-item">
                    <a class="nav-link" href="elementIndex.php" target="adminFrame">元素管理</a>
                </li>
	            <li class="nav-item">
		            <a class="nav-link" href="userIndex.php" target="adminFrame">用户管理</a>
	            </li>
	            <li class="nav-item">
		            <a class="nav-link" href="adminIndex.php" target="adminFrame">管理员账户</a>
	            </li>
	            <!--<li class="nav-item">-->
		        <!--    <a class="nav-link" href="#">模板管理</a>-->
	            <!--</li>-->
	            <!--<li class="nav-item">-->
		        <!--    <a class="nav-link" href="#">模板管理</a>-->
	            <!--</li>-->
            </ul>
            <div class="dropdown show dropleft">
                <a class="dropdown-toggle" href="#" role="button" id="personalCenter" data-toggle="dropdown"
                   aria-haspopup="true" aria-expanded="false">
                    <?= $_COOKIE['adminName'] ?>
                </a>
                <div class="dropdown-menu" aria-labelledby="personalCenter">
                    <a class="dropdown-item" href="logout.php" >退出登录</a>
                </div>
            </div>
        </div>

    </nav>
</div>
<!-- 左侧菜单栏 -->
<div class="container-fluid h-100">
    <div class="row h-100">
        <div class="col-12 h-100">
            <iframe src="" class="w-100 h-100" name="adminFrame" style="border: 0;"></iframe>
        </div>
    </div>
</div>

<?php require_once 'footer.php' ?>
